package com.ahu.rs.admin.controller;

import com.ahu.rs.admin.convention.result.Result;
import com.ahu.rs.admin.convention.result.Results;
import com.ahu.rs.admin.dto.req.UserLoginReqDTO;
import com.ahu.rs.admin.dto.resp.UserLoginRespDTO;
import com.ahu.rs.admin.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;
    /**
     * 用户登录
     */
    @PostMapping("/api/rs/admin/v1/user/login")
    public Result<UserLoginRespDTO> login(@RequestBody UserLoginReqDTO requestParam) {
        return Results.success(userService.login(requestParam));
    }
}
